package fpzhan.plane.program.param;

import fpzhan.plane.program.exception.ExecuteParamToolException;
import fpzhan.plane.program.function.RemoveKeysEmptyException;

import java.util.function.Supplier;

public  class Params {


     public static <T> ExecuteParamTool<T> get(String getKey,Class<T> tClass) throws ExecuteParamToolException {
         return new ExecuteParamTool<T>(getKey,null);
     }

    public static <T> ExecuteParamTool<T> get(Supplier<T> supplier) throws ExecuteParamToolException {
        return new ExecuteParamTool<T>(null,supplier);
    }

    public static  RemoveParamTool lose(String... keys) throws RemoveKeysEmptyException {
         return new RemoveParamTool(keys);
    }

    public static <T> LoopParamTool<T> loop(String getKey,Class<T> tClass) throws ExecuteParamToolException {
        return  new LoopParamTool<T>(getKey, (Supplier) null);
    }

    public static <T> LoopParamTool<T> loop(Supplier<T> supplier) throws ExecuteParamToolException {
        return  new LoopParamTool<T>(null,supplier);
    }

    public static <T> ConditionParamTool<T> judege(String getKey,Class<T> tClass) throws ExecuteParamToolException {
         return new ConditionParamTool<T>(getKey,(Supplier)null);
    }

    public static <T> ConditionParamTool<T> judege(Supplier<T> supplier) throws ExecuteParamToolException {
        return new ConditionParamTool<T>(null,supplier);
    }
}
